package com.bstek.urule.accident.client;

import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.web.client.RestTemplate;

public class ClientUtil {
	public static void main(String[] args) {
		RestTemplate restTemplate = new RestTemplate();
		String requestJson = "{\"name\": \"客户\","
				+ "\"fields\": {"
				+ "\"lowDensityLipoprotein\": \"\"," 
				+ "\"diastolic\": \"63\","
				+ "\"systolic\": \"110\"," 
				+ "\"gender\": \"true\","
				+ "\"name\": \"李四\"," 
				+ "\"cholesterol\": \"\","
				+ "\"id\": \"001\"," 
				+ "\"age\": \"33\"" 
				+ "}" 
				+ "}";
		HttpHeaders headers = new HttpHeaders();
		headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
		HttpEntity<String> entity = new HttpEntity<String>(requestJson, headers);
		String answer = restTemplate.postForObject(
				"http://localhost:8080/urule-demo/urule/rest/寿险意外险核保/totalResultTest", entity, String.class);
		System.out.println(answer);
	}
}
